package com.yohann.order_service.client;

import com.yohann.order_service.entity.Course;
import com.yohann.utils.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * 课程服务代理
 * </p>
 *
 * @author Yohann
 * @since 2020/11/28 23:30
 */
@Component
@FeignClient("course-service")
public interface CourseClient {
    /**
     * 根据id查询课程
     *
     * @param id 课程id
     * @return 返回对应分类
     */
    @GetMapping("/course_service/course/getCourse/{id}")
    Course getCourse(@PathVariable("id") int id);

    /**
     * 查询课程
     *
     * @param title 课程名称
     * @return 课程id集合
     */
    @GetMapping("/course_service/course/searchCourse/{title}")
    public List<Integer> searchCourse(@PathVariable("title") String title);
}